package com.seirsoft.framework.util.db;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class DbService {

	private Connection m_conn = null;
	private Statement m_st = null;
	public DbService(Connection conn)
	{
		m_conn = conn;
	}
	
	public void beginStatement() throws SQLException
	{
		m_st = this.m_conn.createStatement();
	}
	
	public ResultSet select(String strSQL) throws SQLException
	{
        return m_st.executeQuery(strSQL);
	}
	
	public void execute(String strSQL) throws SQLException
	{
		m_st.execute(strSQL);
	}
	
	public void executeUpdate(String strSQL) throws SQLException
	{
		m_st.executeUpdate(strSQL);
	}
	
	public void endStatement() throws SQLException
	{
		m_st.close();
	}
}
